<template>
  <div>
    <a @click.stop.prevent="update(rowData,index)">编辑</a>&nbsp;
    <a @click.stop.prevent="link(rowData,index)">单元</a>
  </div>
</template>
<script>
export default {
  name: 'link-do',
  props: {
    rowData: {
      type: Object
    },
    field: {
      type: String
    },
    unitLink: {
      type: Boolean,
      default: false
    },
    index: {
      type: Number
    }
  },
  methods: {
    update () {
      // 参数根据业务场景随意构造
      let params = { type: 'edit', index: this.index, rowData: this.rowData }
      this.$emit('on-custom-comp', params)
    },
    link () {
      // 参数根据业务场景随意构造
      let params = { type: 'unit', index: this.index, rowData: this.rowData }
      this.$emit('on-custom-comp', params)
    }
  }
}
</script>
<style scoped>
</style>
